<!--
 * @Description: 
 * @Author: Zhangx
 * @Date: 2023-07-28 10:57:09
 * @LastEditors: Zhangx
 * @LastEditTime: 2023-07-28 16:01:13
-->
<script setup lang="ts">
import {ref} from 'vue'
import dialogs from './dialogs/DiaLogs.vue'
const addVisible = ref(false)
const checkVisible = ref(false)
const editVisible = ref(false)
const add = () => {
  addVisible.value = true
}
const edit = () => {
  editVisible.value = true
}
const view = () => {
  checkVisible.value = true
}
</script>

<template>
    <h1>This is an Home page</h1>
    <el-button @click="add">新增</el-button>
    <el-button @click="edit">修改</el-button>
    <el-button @click="view">查看</el-button>
    <!-- 新增 -->
    <dialogs
      v-if="addVisible"
      :dialogVisible="addVisible"
      :is-add="addVisible"
      @close-visible="addVisible = false"></dialogs>
      <!-- 修改 -->
      <dialogs
        v-if="editVisible"
        :dialogVisible="editVisible"
        :is-edit="editVisible"
        @close-visible="editVisible = false"></dialogs>
      <!-- 查看 -->
      <dialogs
      v-if="checkVisible"
      :dialogVisible="checkVisible"
      :is-check="checkVisible"
      @close-visible="checkVisible = false"></dialogs>
</template>
